from sqlmodel import Field,  SQLModel
from .resBase import BaseResponse
# Generic message
class Message(SQLModel):
    message: str



# JSON payload containing access token
class Token(SQLModel):
    access_token: str
    token_type: str

class TokenResponse(BaseResponse):
    data: str | None  # 具体的数据字段类型为 UserPublic



# Contents of JWT token
class TokenPayload(SQLModel):
    userId: str | None = None


class NewPassword(SQLModel):
    token: str
    new_password: str = Field(min_length=8, max_length=40)